/*
 * Copyright (C) 2010 Imavis Srl
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.imavis.avimuxer;

/**
 * A known video encoding.
 * <p>
 * Instances of this class provide useful defaults to the AVI muxer.
 * @see AviMuxerBuilder#encoding(com.imavis.avimuxer.Encoding)
 *
 * @author Andrea Gualano
 */
public enum Encoding {
    /** Motion JPEG video. */
    MJPEG("MJPG"),
    /** MPEG-4 Part 2 video. */
    MPEG4("XVID"),
    /** H.264/MPEG-4 Part 10/AVC video. */
    H264("H264"),
    /** Encoding is unknown or not handled */
    UNKNOWN("CCCC");
    private final FourCC fourCC;

    private Encoding(String fcc) {
        this.fourCC = new FourCC(fcc);
    }

    /**
     * Gets the default four character code (4CC) for this encoding.
     * The AVI muxer will use this 4CC unless overridden.
     *
     * @return the default 4CC string.
     * @see AviMuxerBuilder#fourCC(java.lang.String)
     */
    public String getDefaultFourCC() {
        return fourCC.toString();
    }

    FourCC getFourCC() {
        return fourCC;
    }
}
